try {
    $res = Get-Service "MSExchangeIS" -ErrorAction SilentlyContinue
} catch {
    return $False
}
$res.Status
